<?php

namespace App\Http\Middleware;

use Closure;

class IspcMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
        if(strpos($agent, 'windows nt')||strpos($agent, 'macintosh')) { 
           return $next($request);   
        }else{
            return redirect('mobile/index');
        }
    }
}
